<template>
  <view class="box">
    <view class="banner"></view>
    <product :data="item" v-for="item in list" :key="item.holeId"></product>

  </view>
</template>

<script>
import product from "@/pages/order/product";
import { by_sx } from "@/api";

export default {
  name: "member",
  components: {product},
  data(){
    return{
      list:[]
    }
  },
  onLoad(){
    by_sx({
      type:2
    }).then(e=>{
      this.list = e.data.data.map(e => {
        let txt = []
        let data = [e.isDi, e.isHot, e.isNew]
        for (let i = 0; i < data.length; i++) {
          if (data[i] === '1') {
            if (i === 0) {
              txt.push('低利息')
            } else if (i === 1) {
              txt.push('下款快')
            } else {
              txt.push('额度高')
            }
          }
        }
        console.log(txt)
        e.txt = txt.join(',')
        return e
      })

    })
  }
}
</script>

<style scoped lang="scss">
.banner {
  width: 100%;
  height: 215rpx;
  background: url("~@/static/image/huiyuan.jpg") 0/100% 100%;
}
.none-txt{
  text-align: center;
  height: 500rpx;
  line-height: 500rpx;
  font-size: 40rpx;
  color: #999;
}
</style>
